package com.xiaowen.codeDataRequest.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xiaowen.codeDataRequest.entity.CodeDataRequestParam;
import com.xiaowen.codeDataRequest.mapper.CodeDataRequestParamMapper;
import com.xiaowen.codeDataRequest.service.CodeDataRequestParamService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yf-wenhao
 * @since 2024-11-20
 */
@Service
public class CodeDataRequestParamServiceImpl extends ServiceImpl<CodeDataRequestParamMapper, CodeDataRequestParam> implements CodeDataRequestParamService {

    @Override
    public List<CodeDataRequestParam> listByProjectId(Integer projectId) {
        CodeDataRequestParam codeDataRequestParam = new CodeDataRequestParam();
        codeDataRequestParam.setProjectId(projectId);
        QueryWrapper<CodeDataRequestParam> queryWrapper = new QueryWrapper<>();
        queryWrapper.setEntity(codeDataRequestParam);
        queryWrapper.orderByDesc("create_time");
        return list(queryWrapper);
    }
}
